using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FinishedLaMian
{
    public ERuanYingDu ruanYingDu;

    public EGaoTang gaoTang;

    public ETiaoWeiLiao tiaoWeiLiao;

    public ETiaoWeiDu tiaoWeiDu;

    public List<EPeiCai> peiCais;
}

public class NoodlesBuilder
{
    public ERuanYingDu ruanYingDu;

    public EGaoTang gaoTang;

    public ETiaoWeiLiao tiaoWeiLiao;

    public ETiaoWeiDu tiaoWeiDu;

    public List<EPeiCai> peiCai;

    public NoodlesBuilder BuildRuanYingDu(int second)
    {
        if (second <= 5)
        {
            this.ruanYingDu = ERuanYingDu.MeiShu;
        }
        else if (second > 5 && second <= 9)
        {
            this.ruanYingDu = ERuanYingDu.YingMian;
        }
        else if (second > 9 && second <= 13)
        {
            this.ruanYingDu = ERuanYingDu.ZhongMian;
        }
        else if (second > 13 && second <= 15)
        {
            this.ruanYingDu = ERuanYingDu.RuanMian;
        }
        return this;
    }

    public NoodlesBuilder BuildGaoTang(EGaoTang gaoTang)
    {
        this.gaoTang = gaoTang;
        return this;
    }
    public NoodlesBuilder BuildTiaoWeiLiao(ETiaoWeiLiao tiaoWeiLiao, float tiaoWeiDu)
    {
        this.tiaoWeiLiao = tiaoWeiLiao;
        ETiaoWeiDu du;
        if (tiaoWeiDu < 0.33f)
        {
            du = ETiaoWeiDu.dan;
        }
        else if (tiaoWeiDu >= 0.33f && tiaoWeiDu < 0.66f)
        {
            du = ETiaoWeiDu.gangGangHao;
        }
        else
        {
            du = ETiaoWeiDu.xian;
        }
        this.tiaoWeiDu = du;
        return this;
    }

    public NoodlesBuilder BuildPeiCai(List<EPeiCai> peiCaiList)
    {
        this.peiCai = peiCaiList;
        return this;
    }

    public FinishedLaMian Build()
    {
        FinishedLaMian noodles = new FinishedLaMian();
        noodles.ruanYingDu = this.ruanYingDu;
        noodles.tiaoWeiLiao = this.tiaoWeiLiao;
        noodles.tiaoWeiDu = this.tiaoWeiDu;
        noodles.peiCais = this.peiCai;
        noodles.gaoTang = this.gaoTang;
        return noodles;
    }
}
